package action;

import com.opensymphony.xwork2.ActionSupport;

import java.util.HashMap;
import java.util.Map;

public class JsonAction extends ActionSupport{
    private String username;
    private String password;
    private Map<String, String> map = new HashMap<>();

    @Override
    public String execute() throws Exception {
        if(username == null || password == null){
            return "index";
        }else{
            map.put("user",username);
            map.put("pass",password);
            return SUCCESS;
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }
}
